package com.gugee.ins.common.dal.service.statistics.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gugee.ins.common.dal.mapper.statistics.InsStBloggerCfsAvgExtMapper;
import com.gugee.ins.common.dal.service.statistics.InsStBloggerCfsAvgDao;
import com.gugee.ins.common.model.mysql.statistics.InsStBloggerCfsAvg;
import com.gugee.ins.data.common.msg.InsMBIdenticalLevelMessage;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 *
 */
@Slf4j
@Service
public class InsStBloggerCfsAvgDaoImpl extends ServiceImpl<InsStBloggerCfsAvgExtMapper, InsStBloggerCfsAvg> implements InsStBloggerCfsAvgDao {
    @Override
    public InsStBloggerCfsAvg getByCategoryAndFollowerSize(String category, long sizeId){
        return baseMapper.findByCategoryAndFollowerSize(category,sizeId);
    }

    @Override
    public List<InsMBIdenticalLevelMessage> getInsMBIdenticalLevelMessageList(int start, int row) {
        return baseMapper.getInsMBIdenticalLevelMessageList(start,row);
    }

    /**
     * 更新同量级同分类平均值
     * @param category
     * @param followerSize
     * @param now
     */
    @Override
    public void updateStBloggerCfsAvg(String category, int followerSize,long now){
        baseMapper.updateStBloggerCfsAvg(category,followerSize,now);
    }

    /**
     * 更新同量级同分类广告帖传播率、点赞率、评论率平均值
     * @param category
     * @param followerSize
     * @param limitTime
     * @param now
     */
    @Override
    public void updateStBloggerCfsAdAvg(String category, int followerSize,long limitTime,long now){
        baseMapper.updateStBloggerCfsAdAvg(category,followerSize,limitTime,now);
    }
}
